//清空道具
module py2Obj {


	export class emptyProp extends basicProp {
		//玩家加分
		public pointList: egret.Point[] = [];
		public m_point: number;
		m_fb: fakeBullet;
		public constructor(world: any, gamePanle: any, romveSkins: any) {
			super(world, gamePanle, romveSkins);
			this.objkind = 403;
		}
		public init() {
			super.init();
		}
		public createMyRigidbody(): p2.Body {
			var world: P2World = this.m_world;
			var skin: MImage = this.createSkin("circle6_png");
			//	var body: p2.Body = world.createBoxBodyShape(skin.width, skin.height, p2.Body.KINEMATIC);
			var body: p2.Body = world.createCircleBodyShape(skin.width >> 2, p2.Body.KINEMATIC);
			body.userData.skin = skin;
			body.userData.data = this;
			body.mass = 0;//质量设置为0，就可以按规定方向发射，等发生碰撞之后再给球质量
			//body.gravityScale=0;
			var shape = body.shapes[0];
			shape.collisionMask = 6;
			// trace(shape.collisionGroup,shape.collisionMask)
			return body;
		}
		public Destroy() {
			var goold = new Array();
			goold = PropManager.twoProp;
			if (goold.length > 0) {
				let length = goold.length
				for (let i = 0; i < length; i++) {
					let jinbi = goold[0];
					goold.splice(0, 1);
					this.m_propManger.removePorp1(jinbi);
				}
			}
			else {
				this.m_propManger.removePorp1(this);
			}

			//	this.m_propManger.removePorp1(this);
		}

		public getCollision(otherBody: basicObj) {
			super.getCollision(otherBody);
			if (otherBody.objkind == 301 || otherBody.objkind == 103 || otherBody.objkind == 102 || otherBody.objkind == 104 || otherBody.objkind == 105) {
				GameControl.GameControlSole.empty();//清空所有刚体

				/**新手指导 */
			//	GameControl.GameControlSole.empty1();//如果场景里存在金币，清除金币

				this.Destroy();

			}
		}

	}
}